import service from "@/service";

//查询【字典类别列表】
export function getDictTypeManageList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-type/list?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//【字典类别新增】
export function getDictTypeAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-type/add`,
    method: "POST",
    data,
  });
}

//【删除字典类别】
export function getDictTypeDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-type/delete?id=${id}`,
    method: "POST",
  });
}

//查询【字典名称下拉框】
export function getDictTypeSelectList() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-type/selectData`,
    method: "GET",
  });
}

//查询【字典数据列表】
export function getDictManageList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-data/list?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//【删除字典数据】
export function getDictDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-data/delete?id=${id}`,
    method: "POST",
  });
}

//【字典数据导出】
export function exportDict(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-data/export`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
    data,
  });
}
//【字典数据新增】
export function getDictAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-data/add`,
    method: "POST",
    data,
  });
}
